<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
      

<ui:composition template="/Template.xhtml">
<ui:define name="page">
	<h1>Modification de l'annonce</h1>
	<input type="hidden" name="acid" value="#{AnnoncesSession.annoncec.id}"/>
	<table>
		<tr>
			<td>
				<h:form>
				<table width="500">
					<tr height="20">
						<td colspan="3"><font color="#ff0000">* Champs requis</font></td>
					</tr>
					<tr>
						<td align="right">
							Titre<font color="#ff0000">*</font>
						</td>
						<td width="15"></td>
						<td>
			                <h:inputText value="#{AnnoncesSession.annoncec.annonceentity.titre}" required="true"  id="titre"/>
			                <h:message for="titre"/>				
						</td>
					</tr>
					<tr>	
						<td align="right">
							Texte<font color="#ff0000">*</font>
						</td>
						<td width="15"></td>
						<td>
			                <h:inputTextarea value="#{AnnoncesSession.annoncec.annonceentity.texte}" required="true"  id="texte" cols="45" rows="20"/>
			                <h:message for="texte"/>				
						</td>
					</tr>
					<tr>	
						<td align="right">
							Code Postal<font color="#ff0000">*</font>
									<div style="color:#aeaeac; min-width:60px; " >
										(Ex: 38920)
									</div>
						</td>
						<td width="15"></td>
						<td>
			                <h:inputText value="#{AnnoncesSession.annoncec.annonceentity.departement}" required="true"  id="departement"/>
			                <h:message for="departement"/>				
						</td>
					</tr>
					<tr>	
						<td align="right">
							Ville<font color="#ff0000">*</font>
									<div style="color:#aeaeac; min-width:60px; " >
										(Ex: Crolles)
									</div>
						</td>
						<td width="15"></td>
						<td>
			                <h:inputText value="#{AnnoncesSession.annoncec.annonceentity.ville}" required="true"  id="ville"/>
			                <h:message for="ville"/>				
						</td>
					</tr>
					<tr>
						<td align="right" colspan="3">
							<h:commandButton value="Sauvegarder" action="#{AnnoncesSession.changeAnnoncec}" />
						</td>
					</tr>
					
				</table>
				</h:form>
			</td>
			<td valign="top">
				<h:form  enctype="multipart/form-data">
					<input type="hidden" name="acid" value="#{AnnoncesSession.annoncec.id}"/>
					<table width="300">
						<tr>	
							<td align="right">
								Selectionner votre photo
							</td>
							<td width="15"></td>
							<td>
								 <p:growl id="messages" showSummary="true" showDetail="true" />			 
								 <p:fileUpload fileUploadListener="#{AnnoncesSession.uploadPhoto}" 
								   auto="true" sizeLimit="1073741824" update="messages,maphoto"
								   multiple="true" label="Parcourir..." allowTypes="*.jpg;*.png;*.gif;" 
								   description="Images" id="upphoto"/>
							</td>
						</tr>
						<tr height="20"></tr>
						<tr>
							<td colspan="3" align="center">
								<h:graphicImage id="maphoto" value="#{AnnoncesSession.photo}" style="max-width:250px;" />
							</td>
						</tr>
					</table>
				</h:form>				
			</td>
		</tr>
	</table>
</ui:define>
</ui:composition>
</html>